from tempfile import TemporaryFile

with TemporaryFile('w+') as f:
    f.write('hello south')
    f.seek(1)
    f.write('eee')
    data=f.readlines()
    print(data)
